import { AmuletSpiritConfig } from "../../resource/AmuletSpiritConfig";
import { Cache } from "../../cache/Cache";
import { TAmuletSpiritConfig } from "../../../../Message/Db/Tables/TAmuletSpiritConfig";
type int = number;
//class FahunItemInfo
    
    export  class FahunItemInfo
    {
        

        public get level(): int
        {
            return this._level;
        }

        public set level(arg1: int)
        {
            this._level = arg1;
            this._configInfo = AmuletSpiritConfig.instance.getConfigByLevel(this._level);
            return;
        }

        public get isMaxLevel(): Boolean
        {
            return this.level == Cache.instance.fahun.maxLevel;
        }

        public get isNeedBreak(): Boolean
        {
            return this._configInfo && this._configInfo.breakMaterials > 0 && !this.isBreaked;
        }

        public get isBreaked(): Boolean
        {
            return !(this.breakLevel == 0) && this._level == this.breakLevel || this._level > 90;
        }

        public get starNum(): int
        {
            var loc1=0;
            if (this.isBreaked) 
            {
                loc1 = this.level % 10;
            }
            else if (this.level % 10 != 0) 
            {
                loc1 = this.level % 10;
            }
            else if (this.level != 0) 
            {
                loc1 = 10;
            }
            else 
            {
                loc1 = 0;
            }
            return loc1;
        }

        public copy(arg1: FahunItemInfo): void
        {
            this.index = arg1.index;
            this.level = arg1.level;
            this.breakLevel = arg1.breakLevel;
            this.isEnable = arg1.isEnable;
            return;
        }

        public /* var */index: int;

        /* internal */ /* var */_level: int;

        public /* var */isEnable: Boolean;

        public /* var */breakLevel: int;

        /* internal */ /* var */_configInfo: TAmuletSpiritConfig;
    }
